import request from './request.js'

export const getCoaches = (params) => {
    return request({
        url: '/api/admin/get_coach_list',
        method: 'GET',
        params
    });
};

export const updateCoach = (data) => {
    return request.post(`/api/admin/update_coach_info`, data);
};

export const getOneCoachInfo = (coachId) => {
    return request.post('/api/admin/get_one_coach_info', {
        coach_id: coachId
    });
};


export const getRegionList = () => {
    return request({
        url: '/api/get_region',
        method: 'GET'
    });
};

export const getUUID = (id) => {
    return request({
        url: `/api/admin/coach/${id}/uuid`,
        method: 'get',
    });
};

export const changeCoachPassword = (data) => {
    return request.post('/api/admin/reset_coach_password', data);
};


export const updateCoachLogo = (coachId, formData) => {
    return request.post(`/api/admin/update_coach_logo/${coachId}`, formData, {
        headers: {
            'Content-Type': 'multipart/form-data',
        }
    });
};

export const updateCoachQrcode = (coachId, formData) => {
    return request.post(`/api/admin/upload_qr_code/${coachId}`, formData, {
        headers: {
            'Content-Type': 'multipart/form-data',
        }
    });
};

